import java.util.Objects;
import java.util.Scanner;

public class TestDemo {
    public static void main1(String[] args) {
        System.out.println("hello world");
    }
    //0-100 9的出现次数
    public static void main(String[] args) {
        int count=0;
        for(int i=1;i<=100;i++){
            int ret=i;
            while(ret != 0){
                if(ret%10==9) count++;
                ret=ret/10;
            }
        }
        System.out.println(count);

    }
    //打印x图形
    public static void main10(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            int n=scanner.nextInt();
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    if(i==j || i+j==n-1){
                        System.out.print("*");
                    }
                    else{
                        System.out.print(" ");
                    }
                }
                System.out.print("\n");
            }
        }
    }
    //判断素数
    public static void main7(String[] args) {
        Scanner scanner =new Scanner(System.in);
        int i=scanner.nextInt();
        if(i==2)
            System.out.printf("%d是素数 ",i);
            for(int j=2;j<=i-1;j++){
                if(i%j==0) {
                    System.out.printf("%d不是素数 ",i);
                    break;
                }
                else if(j==i-1) {
                    System.out.printf("%d是素数 ",i);
                }
            }
    }
    //1-100的素数
    public static void main6(String[] args) {
        for(int i=1;i<=100;i++){
            if(i==2)
                System.out.printf("%d是素数 ",i);
            for(int j=2;j<=i-1;j++){
                if(i%j==0) {
                    break;
                }
                else if(j==i-1) {
                    System.out.printf("%d是素数 ",i);
                }
            }
        }
    }
    //辗转相除求最大公约数
    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int m = a > b ? a : b;
        int n = a > b ? b : a;
        int ret = 0;
        while (n != 0) {
            ret = m % n;
            m = n;
            n = ret;
        }
        System.out.println(m);
    }
//    打印闰年
    public static void main5(String[] args) {
        for(int i=1000;i<=2000;i++){
            if(i%100!=0 && i%4==0){
                System.out.printf("%d年是闰年 ",i);
            }
            else if(i%400==0){
                System.out.printf("%d 年是闰年",i);
            }
        }
    }
//    水仙花数
    public static void main4(String[] args) {
        for(int i=0;i<1000;i++){
            int sum=0;
            int m=0;
            int ret=i;
            while(ret != 0){
                m=ret%10;
                sum+=Math.pow(m,3);
                ret=ret/10;
            }
            if(sum==i){
                System.out.println(i);
            }
        }
    }
//    模拟登陆
    public static void main3(String[] args) {
        Scanner scanner =new Scanner(System.in);
        int count=0;
        while(true) {
            String pass="mima123@";
            System.out.println("请输入密码:");
            String str = scanner.nextLine();
            if(Objects.equals(str, pass)) {
                System.out.println("验证成功");
                break;
            }
                System.out.println("验证失败，请重新输入:");
                count++;
                if (count == 3) {
                    System.out.println("输错3次，无法再次输入");
                    break;
                }
        }
    }
//    输出乘法口诀表
    public static void mian2(String[] args) {
        Scanner scanner =new Scanner(System.in);
        int n=scanner.nextInt();
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=i;j++)
            {
                System.out.printf("%d * %d = %d ",i,j,i*j);
            }
            System.out.printf("\n");
        }
    }
}